import { mode as DEV_MODE } from './mode' // * DON'T DELETE
import { app, BrowserWindow, screen, Menu } from 'electron'

app.whenReady().then(() => {
  const screenSize = screen.getPrimaryDisplay().size
  const win = new BrowserWindow({
    width: screenSize.width,
    height: screenSize.height - 170,
    frame: false,
    transparent: true,
    webPreferences: {
      nodeIntegration: true
    }
  })
  win.webContents.openDevTools()
  // * ========== DEV TOOL INSIDE ============= ||
  // @ts-ignore                             //* ||
  if (DEV_MODE === 'dev') { 
    Menu.setApplicationMenu(null) 
    win.loadURL('http://localhost:3000/') //* ||
  } else {
    Menu.setApplicationMenu(null)  
    win.loadFile('dist/view/index.html') //* ||
  } //* ||
  // * ========================================||

  // * YOUR CODE HERE
})

// * YOUR CODE HERE

// * ============ DEV TOOL INSIDE ==========||
// @ts-ignore                            //*||
try {
  //* ||
  require('electron-reloader')(module) //* ||
} catch {} //* ||
// * =======================================||
// * HERE IS THE END
